<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<title>FLDCMS后台管理系统</title>
<meta name="keywords" content="FLDCMS，FLDCMS后台管理系统">
<meta name="description" content="FLDCMS，是一款由FLD开发的轻量级扁平化网站后台模板，适合中小型CMS后台系统。">
{include file="public/header" /}
<style>
	img[nc_type="flex"]{cursor:pointer;}
</style>
</head>
<body>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页
	{notempty name="$node_info.p_title"}
	<span class="c-gray en">&gt;</span>
		{$node_info.p_title}
	{/notempty}
	{notempty name="$node_info.node_title"}
	<span class="c-gray en">&gt;</span>
		{$node_info.node_title}
	{/notempty}
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" >
		<i class="Hui-iconfont">&#xe68f;</i>
	</a>
</nav>
<article class="page-container">
	<div class="tabBar cl">
		{containstr name=":session('act_list')" value="Admin_index"}
		<a href="{:url('admin/index')}"><span>管理员</span></a>
		{/containstr}
		{containstr name=":session('act_list')" value="Admin_add"}
		<a href="{:url('admin/add')}"><span class="current">添加管理员</span></a>
		{/containstr}
		{containstr name=":session('act_list')" value="Role_index"}
		<a href="{:url('role/index')}"><span>角色</span></a>
		{/containstr}
		{containstr name=":session('act_list')" value="Role_add"}
		<a href="{:url('role/add')}"><span>添加角色</span></a>
		{/containstr}
	</div>
	<form action="{:url('admin/add')}" method="post" class="form form-horizontal" id="form-add">
		<input type="hidden" name="form_submit" value="ok"/>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账号：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请填写管理员账号" id="admin_name" name="admin_name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="请填写姓名" id="admin_truename" name="admin_truename">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="password" class="input-text" value="" placeholder="请填写密码" id="password" name="password">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">确认密码：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="password" class="input-text" value="" placeholder="请填写密码" id="confirm_password" name="confirm_password">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">所属角色：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<span class="select-box radius">
					<select name="admin_role_id" class="select">
						{foreach name="role_list" item="vo"}
							<option value="{$vo.role_id}">{$vo.role_name}</option>
						{/foreach}
					</select>
				</span>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button class="btn btn-secondary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
			</div>
		</div>
	</form>
</article>
{include file="public/footer" /}
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	
	$("#form-add").validate({
		rules:{
			admin_name:{
				required:true,
				minlength:3,
				maxlength:20,
				remote: {
				    url: "{:url('admin/check_ajax')}",    //后台处理程序
				    type: "post",               //数据发送方式
				    dataType: "json",           //接受数据格式   
				    data: {                     //要传递的数据
				    	'admin_name': function() {return $("#admin_name").val();}
				    }
				}
			},
			admin_truename:{
				required:true,
				maxlength:20,
			},
			password:{
				required:true,
				minlength:6,
				maxlength:20,
			},
			confirm_password:{
				equalTo:"#password",
			}
		},
		messages: {
			admin_name:{
				required:'管理员账号不能为空',
				minlength:'管理员账号不能小于3个字符',
				maxlength:'管理员账号不能大于20个字符',
				remote : '管理员账号已经存在',
			},
			admin_truename:{
				required:'姓名不能为空',
				maxlength:'姓名不能大于20个字符',
			},
			password:{
				required:'密码不能为空',
				minlength:'密码不能小于6个字符',
				maxlength:'密码不能大于20个字符',
			},
			confirm_password:{
				equalTo:'确认密码和密码不一致',
			}
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid"
	});
});

</script>
</body>
</html>